from django.db import models

class Class(models.Model):
    name=models.CharField(max_length=20)
    num=models.IntegerField()
    teacher=models.CharField(max_length=20)
    class Meta:
        db_table='class'

class Student(models.Model):
    name=models.CharField(max_length=20)
    age=models.IntegerField()
    cate=models.ForeignKey(Class,on_delete=models.SET_NULL,null=True)
    class Meta:
        db_table='student'
